#ifndef crc32_h
#define crc32_h

#include <string>

typedef struct { unsigned long long A, B; } u128;

extern "C" unsigned short int __stdcall crc16 (void *q, unsigned int length);
extern "C" unsigned int __stdcall crc32 (void *q, unsigned int length);
extern "C" unsigned long long __stdcall crc64 (void *q, unsigned int length);
extern "C" u128 __stdcall crc128(u128 crc, const unsigned char *buf, unsigned long buflen);
extern "C" char* __stdcall base64enc(unsigned char const* bytes_to_encode, unsigned int in_len);
extern "C" char* __stdcall base64dec(unsigned char const* bytes_to_encode, unsigned int in_len);

unsigned int crc32 (const std::string &s){ return crc32( (void*)&s[0], s.size() ); }
std::string base64enc(const std::string &s) {return base64enc((unsigned char*)&s[0],s.size()); }
std::string base64dec(const std::string &s) {return base64dec((unsigned char*)&s[0],s.size()); }
#include "src/crc.cpp" 
#endif